cmake_minimum_required(VERSION 3.0)
project(YourProjectName)

# 设置 C++ 编译器
set(CMAKE_CXX_COMPILER g++)
set(CMAKE_CXX_STANDARD 11)

# 添加编译选项
add_compile_options(-Wall -g -std=c++11 -I/usr/include/opencv4 -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include)

# 查找 OpenCV 包
find_package(OpenCV REQUIRED)

# 设置 include 目录
include_directories(${OpenCV_INCLUDE_DIRS})

# 查找 GStreamer 包
find_package(PkgConfig REQUIRED)
pkg_check_modules(GSTREAMER REQUIRED glib-2.0 gstreamer-1.0 gstreamer-app-1.0 gstreamer-video-1.0 gstreamer-rtsp-server-1.0)

# 设置 include 目录
include_directories(${GSTREAMER_INCLUDE_DIRS})

# 设置链接目录
link_directories(${GSTREAMER_LIBRARY_DIRS})

# 添加可执行文件
add_executable(test_stitching src/test_stitching.cpp)

# 链接 OpenCV 和 GStreamer 库
target_link_libraries(test_stitching ${OpenCV_LIBRARIES} ${GSTREAMER_LIBRARIES} pthread)
